package com.ats.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.ats.service.ClasseService_xh;
import com.ats.serviceimpl.ClasseServiceImpl_xh;


import net.sf.json.JSONArray;
/**
 * 获取班级名字
 * @author Administrator
 *
 */
public class FindClasseController_xh extends HttpServlet{
	ClasseService_xh clser = new ClasseServiceImpl_xh();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		resp.setCharacterEncoding("utf8");
		HttpSession session =req.getSession();
		PrintWriter  pw = resp.getWriter();
		//获取班级名字
		JSONArray jso=clser.findClasse();
		pw.write(jso.toString());
		pw.flush();
		pw.close();
	}

}
